<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript" src="js/jquery-1.12.4.js"></script>
<script type="text/javascript">
	$(function(){
		$("tr:even").css("backgroundColor","#9f9f9f");
	});
	function dele(id) {
		if (confirm("确定要删除吗?")) {
			$.getJSON("Dele","id="+id,function(data){
				if (data.count>0) {
					alert("删除成功!");
					window.location.href="List";
				}else{
					alert("删除失败!");
				}
			});
		}else{
			alert("您取消了删除!");
		}
		
	}
</script>
</head>
<body>
<c:if test="${empty requestScope.list }">
<script type="text/javascript">
	window.location.href="List";
</script>
</c:if>
	<div>
		<h2>雨量监测信息</h2>
		<table border="1">
			<tr>
				<th>序号</th>
				<th>区域名称</th>
				<th>监测时间</th>
				<th>雨量值(mm)</th>
				<th>监测站</th>
				<th>站点地址</th>
				<th>操作</th>
			</tr>
			<c:forEach var="arin" items="${requestScope.list }">
			<tr>
				<td align="center">${arin.id }</td>
				<td>${arin.name }</td>
				<td>${arin.time }</td>
				<td align="center">${arin.rain }</td>
				<td>${arin.station }</td>
				<td>${arin.address }</td>
				<td><a href="javascript:dele(${arin.id })">删除</a></td>
			</tr>
			</c:forEach>
		</table>
		<p><a href="Add.jsp">新增雨量监测信息</a></p>
	</div>
</body>
</html>